package com.it.you.controller.pay;

import com.it.you.common.annotation.RateLimited;
import com.it.you.service.pay.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pay")
public class PayController {

    @Autowired
    private PayService payService;

    @Autowired
    private PayService2 payService2;

    @Autowired
    private PayService3 payService3;

    @Autowired
    private PayService4 payService4;

    @Autowired
    private PayService5 payService5;

    @RateLimited(value = 10,duration = 60)
    @GetMapping("/payMode")
    public String payMode(String code) {
        return payService.toPay(code);
    }

    @GetMapping("/payMode2")
    public String payMode2(String code) {
        return payService2.pay(code);
    }

    @GetMapping("/payMode3")
    public String payMode3(String code) {
        return payService3.pay(code);
    }

    @GetMapping("/payMode4")
    public String payMode4(String code) {
        return payService4.pay(code);
    }

    @GetMapping("/payMode5")
    public String payMode5(String code) {
        return payService5.pay(code);
    }

}
